package oneD.dynamics;

import inf.jlinalg.Vector3D;

import java.util.ArrayList;

public class DynamicNode {
	private ArrayList<Vector3D> displacement_;
	private ArrayList<Vector3D> velocity_;
	private ArrayList<Vector3D> acceleration_;

	public DynamicNode() {
		this.displacement_ = new ArrayList<Vector3D>();
		this.velocity_ = new ArrayList<Vector3D>();
		this.acceleration_ = new ArrayList<Vector3D>();
	}

	public int getSize() {
		return this.displacement_.size();
	}

	public Vector3D getDisplacement(int step) {
		return displacement_.get(step);
	}

	public void addDisplacement(Vector3D displacement_) {
		this.displacement_.add(displacement_);
	}

	public Vector3D getVelocity(int step) {
		return velocity_.get(step);
	}

	public void addVelocity(Vector3D velocity_) {
		this.velocity_.add(velocity_);
	}

	public Vector3D getAcceleration(int step) {
		return acceleration_.get(step);
	}

	public void addAcceleration(Vector3D acceleration_) {
		this.acceleration_.add(acceleration_);
	}

	public Vector3D get(int step, int type) {
		switch (type) {
		case 0:
			return displacement_.get(step);
		case 1:
			return velocity_.get(step);
		case 2:
			return acceleration_.get(step);
		default:
			return null;
		}
	}
}
